﻿/*using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SharePointOptimizer.Model;
using SharePointOptimizer.Model;

namespace SharePointOptimizer.BL.DataAnalysis.IssueTypes
{
    public class ServerMorethanOneInstanceRunning :IssueTypeCheckBase
    {



        public override void Check()
        {

            //TODO:KK Add linq query here to extract issues from database

            SharePointOptimizerDataContext dc = new SharePointOptimizerDataContext(System.Configuration.ConfigurationManager.AppSettings["ConnectionStringSSHCDatabase"]);
            //Issue issue;

            
            //SAMPLE REMOVE!
            //// Get all Service instance that has ServiceTypeID 1
            //var Qryinstances = from s in dc.Services
            //                   where s.ServiceTypeID == 1 
            //                   group s by new { s.Server
            //                    } into si
            //                   select new
            //                   {
            //                       Server = si.Key.Server,
            //                       NumberOfInstances = si.Count()
            //                   };


            //foreach (var item in Qryinstances)
            //{
            //    if (item.NumberOfInstances > 1)
            //    {
            //        //Get Issuetype object

            //        issue = new Issue();

            //        //Get Issuetype object  And Create a new  Global issue object 
            //        IssueType issueType = dc.IssueTypes.FirstOrDefault(i => i.IssueTypeId == IssueTypeId);

            //        issue.IssueType = issueType;
            //        issue.TargetId = item.Server.ServerID;
            //        issue.Description = issueType.Description.Replace("{ServerName}", item.Server.Name);

            //        dc.Issues.InsertOnSubmit(issue);  
                
            //    }

            //    dc.SubmitChanges();    
            //}          
        
        
        
        
        
        
        }

    }
       
}
*/